<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.io.File" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<html>
<head>

</head>
<body>
<center>
<% 
String path=application.getRealPath("/WEB-INF/files");

File dir=new File(path);
String files[]=dir.list();
request.setAttribute("FILES",files);

%>

<h1>Using Request Parameter</h1><br/>

<logic:iterate id="file" name="FILES">
<html:form action="/downloadfromreq.do">
<html:hidden property="filename" value="${file}"/>
<html:submit value="Download ${file}"/>
<br/>

</html:form>

</logic:iterate>

<h1>Using Mapping Parameter</h1><br/>

<html:form action="/downloadusingmappingparameter.do">
<html:hidden property="filename" value="${file}"/>
<html:submit value="Download PDF"/>
<br/>
</html:form>

</center>

</body>
</html>